home *** CD-ROM | disk | FTP | other *** search
/ MACD 5 / MACD 5.bin / workbench / tools / czesc_2 / guispell-1.0 / rexx / ced / wordspell.ced < prev    next >
Text File  |  1992-03-25  |  2KB  |  57 lines

  1. /*  
  2.  *  WordSpell.ced ... ARexx Program to spell check a word while in CED!
  3.  *  Requires ISpell version 2.1ljr (or later) with ARexx Server mode.
  4.  *  Started: LJR  12/19/89
  5.  *  Updated for CED v2.0: LJR  Tue Jan 23 03:11:24 1990
  6.  *  Updated for OS 2.04: LJR  Sat Nov 23 17:40:36 1991
  7.  *  Updated for IGadSpell: LJR  Sun Dec  8 17:01:41 1991
  8.  *  Reworked for GUISpell public release: Thu Mar 26 02:12:39 1992 LJR
  9.  *  Copyright © 1989, 1990, 1991  Loren J. Rittle
  10.  *  Use as you will, just document your changes and keep my copyright
  11.  *  notice intact.
  12.  *
  13.  *  Loren J. Rittle
  14.  *  l-rittle@uiuc.edu
  15.  */
  16. options results
  17. if pos('IRexxSpell',(show(ports))) = 0 then do
  18.   address command 'run <nil: >nil: ispell -r >nil: <nil:'
  19.   address command waitforport 'IRexxSpell'
  20. end
  21.  
  22. status 87; bytepos = result;
  23. status 57; linepos = result;
  24. status 55; line = result;
  25. parse var line curline '0a'x
  26.  
  27. curpos = 0
  28. do forever
  29.   curpos=pos('09'x, curline, curpos+1)
  30.   if curpos == 0 then break
  31.   curline = overlay(' ', curline, curpos)
  32. end
  33.  
  34. do i = 1 to words(curline)
  35.     if wordindex(curline, i)-1 > bytepos then
  36.   break
  37.   end
  38.  
  39. item = compress( word( curline, i-1 ), ' ~`,./<>?;:"[]{}!@#$%^&*()+|=\' )
  40.  
  41. if item = '' then exit
  42.  
  43. address 'IRexxSpell' quickcheck item
  44. if result = 'bad' then do
  45.     if pos('GUISpell',(show(ports))) = 0 then do
  46.         address command 'run <nil: >nil: GUISpell <nil: >nil:'
  47.         address command waitforport 'GUISpell' 
  48.       end
  49.     if pos('GUISpell',(show(ports))) ~= 0 then do
  50.     address 'GUISpell' checkcallbackhook 'rexx:ced/WordSpellCallBack.rexx' bytepos linepos item
  51.         address 'GUISpell' check item
  52.       end
  53.     else
  54.       address 'PingServer' beep
  55.   end
  56. exit
  57.